package model.housedetail.mapper;

import model.housedetail.entity.Detail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.List;
@Mapper
public interface DetailMapper {


    @Insert("insert into detail values(#{detailId},#{detailAddress},#{detailBussines},#{detailCompon},#{detailOpen},#{detailHanddate},#{detailGrass},#{detailProperty},#{detailWarm},#{detailElecticity},#{detailEquity},#{detailHouseholds},#{detailBuild},#{detailArea},#{detailPolt},#{detailDetails})")
    void save(Detail detail);


    @Delete("delete from detail where detailId = #{detailId}")
    void  del(String detailId);



    @Select("select * from detail")
    List<Detail> findAll();

    @Select("select * from detail where detailId = #{detailId}")
    Detail findById(String id);


    //两张表查询  楼盘姓名和楼盘详细信息的名称一致的话，找出来

    @Select("select * from detail where detail_housename = #{evaluateUsername}")
    Detail findByName(String evaluateUsername);
}
